<template>
	<view>
			<view class="top">
				<u-search animation="false" placeholder="日照香炉生紫烟" v-model="keyword"></u-search>
				<view class="l">
					<text>综合推荐</text>
					<text>销售</text>
					<text>价格</text>
					<text>好评度</text>
					<text>店铺</text>
					<text>筛选</text>
				</view>
			</view>
			<view class="content">
				<ul>
					<li v-for="item in list" :key="item.id" @click='tz(item.id)'>
						<view class="img">
							<image :src="'http://localhost:3000'+item.img" mode=""></image>
						</view>
						<view class="">
							<view class="">
							{{item.goodsname}}
							</view>
							<view class="price">
								<text>￥{{item.price}}</text><text>￥{{item.market_price}}</text>
							</view>
							<view class="xian">
                            11.11限时299元起
							</view>
							<view class="ping">
								<text>999条好评</text><text>99.9%好评</text>
							</view>
						</view>
					</li>
			
				</ul>
			</view>
	</view>
</template>

<script>
	import {getGoodlist} from '../../request/app.js'
	export default {
		data() {
			return {
				list:[]
			}
		},
		
		onLoad(options) {
			this.getGoodlists({cateid:options.cateid,type:options.type})
		},
		methods: {
			async getGoodlists(i) {
				let result = await getGoodlist({cateid:i.cateid,type:i.type})
				console.log(result,'2222222');
				if (result.data.code == 200) {
						this.list=result.data.list.goodData
				}
			},
			tz(id){
				console.log(id,'1111');
				uni.navigateTo({
					url:'../detail/detail?id='+id
				})
			},
	
		}
	}
</script>

<style>
.top{
	background-color: #FF6600;
}
.top .l{
	display: flex;
	justify-content: space-around;
	color: white;
	height: 60rpx;
	line-height: 60rpx;
}
.content .img image{
	width: 200rpx;
	height: 200rpx;
	margin-right:20rpx
}
ul{
	padding:40rpx;
}
li{
	display:flex;
}
li view{
	margin-top: 18rpx;
}
li .price text:nth-child(1){
	color: red;
}
li .price text:nth-child(2){
	color: #ccc;
	text-decoration: line-through;
}
li .xian{
	background-color: #FF6600;
	color: white;
	width: 280rpx;
	text-align: center;
}
li .ping text:nth-child(2){
	margin-left: 20rpx;
}
li .ping{
	color: #ccc;
}
</style>
